package c.x.jy.common.utils;

import org.ansj.domain.Term;
import org.ansj.splitWord.analysis.BaseAnalysis;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wugr on 2016/6/30 0030.
 */
public class AnsjUtil {

    public static List<String> spltWord(String s){
        List<Term> parse = BaseAnalysis.parse(s);
        List<String> list = new ArrayList<>();
        for (Term t:parse) {
            list.add(t.getName());
        }
        return list;
    }

    public static void main(String[] args){
        List<Term> parse = BaseAnalysis.parse("让战士们过一个欢乐祥和的新春佳节。");
        for (Term t:parse) {
            System.out.println(t.getName());
        }
    }
}
